import json from "rollup-plugin-json";
import typescript from "rollup-plugin-typescript2";
import sourceMaps from "rollup-plugin-sourcemaps";
import polyfillNode from "rollup-plugin-polyfill-node"
import nodeResolve from "@rollup/plugin-node-resolve"

const libraryName = 'Jesium'

export default {
  input: "modules/index.ts",
  output: [
    { format: "es", file: 'lib/main.esm.js' },
    { format: "umd", file: 'lib/main.umd.js', name: libraryName },
  ],
  plugins: [
    json(),
    typescript({
      exclude: ["node_modules/**", "src/**"],
      typescript: require("typescript"),
      useTsconfigDeclarationDir: true
    }),
    sourceMaps(),
    polyfillNode(
      {exclude: ["node_modules/**", "src/**"],}
    ),
    nodeResolve()
  ],
  external: ["cesium", "@turf/turf"]
};
